package com.butang.Exception;

import com.butang.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.rmi.server.ExportException;

/**
 * ClassName: GlobalExceptionHandler
 * Package: com.butang.Exception
 * Description:
 *
 * @Author BuTang
 * @Create 2023/7/18 13:54
 * @Version 1.0
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public Result globalExceptionHandler(Exception e){
        e.printStackTrace();
        return Result.error("出现错误，请联系管理员");
    }
}
